package web;

import factories.BeanFactory;
import factories.BeanFactory_CGLIBProxy;
import factories.BeanFactory_JDKProxy;
import service.OrderService;
import service.UserService;
import service.impl.OrderServiceImpl1;

public class OrderController {

    //在web层中通过new的方式，获取service的对象
//    private static UserService userService = new UserServiceImpl2();

    //通过工厂获取想要的对象
    private static OrderServiceImpl1 orderService = (OrderServiceImpl1) BeanFactory_CGLIBProxy.getBean("orderService");

    public static void main(String[] args) {
//        System.out.println(userService);

        orderService.findAll();

        orderService.findById(1);

        orderService.insert("aa","123",12);

    }
}
